package com.edu.test.commandPattern;

import sun.applet.AppletClassLoader;

/**
 * @作者 five-five
 * @创建时间 2020/12/26
 */
public class Client {
    public static void main(String[] args) {
        Invoker invoker = new Invoker();
        Reciver reciverA = new ReciverA();
        Reciver reciverB = new ReciverB();
//        Command command1 = new ConcreteCommandA();
//        Command command2 = new ConcreteCommandB();
//        System.out.println(command1.reciver);
//        System.out.println(command2.reciver);
        Command commandA = new ConcreteCommandA(reciverA);
        Command commandB = new ConcreteCommandB(reciverB);
        invoker.addCommand(commandA);
        invoker.addCommand(commandB);
        invoker.executeCommands();
    }
}
